<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:61:"D:\www\tp7./application/houtai\view\database\repair_list.html";i:1503648500;s:54:"D:\www\tp7./application/houtai\view\public\header.html";i:1504938710;}*/ ?>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title>樱桃的站点后台管理系统</title>  
<link rel="shortcut icon" href="__INDEX__/images/favicon.ico">
<link rel="stylesheet" href="__HOUTAI__/css/pintuer.css">
<link rel="stylesheet" href="__HOUTAI__/css/admin.css">

<script src="__HOUTAI__/js/jquery-2.1.4.min.js"></script>
<script src="__HOUTAI__/js/layer.js"></script>


<script src="__HOUTAI__/js/jquery.validate.js"></script>
<script src="__HOUTAI__/js/additional-methods.js"></script>
<script src="__HOUTAI__/js/messages_zh.js"></script>
<!-- 字体图标文件CSS -->
<link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_394272_s1c3jukr7t10dx6r.css">
<!-- 字体图标文件js -->
<script type="text/javascript" src="//at.alicdn.com/t/font_394272_s1c3jukr7t10dx6r.js"></script>


<!-- <script type="text/javascript" src="http://malsup.github.io/jquery.form.js"></script> -->

</head>
<body>
<div class="panel admin-panel">
<div class="panel-head"><strong class="icon-menu"> 数据库恢复</strong></div>

<table class="table table-hover text-center">
  <tr>
    <td width="150" align="center">备份名</td>
    <td width="150" align="center">备份时间</td>
    <td width="150" align="center">备份大小</td>
    <td width="100" align="center">卷数</td>
    <td width="100" align="center">压缩</td>
    <td width="100" align="center">状态</td>
    <td width="150" align="center">操作</td>
  </tr>
  <?php if(is_array($_list) || $_list instanceof \think\Collection || $_list instanceof \think\Paginator): $i = 0; $__LIST__ = $_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$data): $mod = ($i % 2 );++$i;?>
  <tr class="hover">
    <td width="150" align="center"><?php echo date('Ymd-His',$data['time']); ?></td>
    <td width="150" align="center"><?php echo $key; ?></td>
    <td width="150" align="center"><?php echo format_bytes($data['size']); ?></td>
    <td width="100" align="center"><?php echo $data['part']; ?></td>
    <td width="100" align="center"><?php echo $data['compress']; ?></td>
    <td width="100" align="center" class="info">-</td>
    <td width="150" align="center" class="handle">
      <div class="button-group"> 
        <a class="button border-red" href="javascript:if(confirm('您确定要删除吗?')){location.href='<?php echo url('del?time='.$data['time']); ?>'};"><span class="icon-shanchu"></span> 删除</a> 
        <a class="button border-main confirm-on-click" href="<?php echo url('import?time='.$data['time']); ?>"><span class="icon-huifu-copy"></span> 导入</a> 
        <a class="button border-main" href="<?php echo url('downFile',array('type'=>'gz','file'=>date('Ymd-His',$data['time']))); ?>"><span class="icon-xiazai1-copy-copy"></span> 下载</a> 
      </div>
    </td>
  </tr>
  <?php endforeach; endif; else: echo "" ;endif; ?>
  <tr>
  </tr>
</table>
  </div>
<script src="__HOUTAI__/js/jquery-1.8.2.min.js"></script>

<script type="text/javascript">
$('.confirm-on-click').live('click', function() {
  var self = this,
      status = ".";
  if(confirm('确认导入这项吗？')){
      } else {
      return false;
  }
  $.get(self.href, success, "json");
  window.onbeforeunload = function(){ return "正在还原数据库，请不要关闭！" }
  return false;

  function success(data){
      if(data.code){
          if(data.data.gz){
              data.msg += code;
              if(code.length === 5){
                  code = ".";
              } else {
                  code += ".";
              }
          }
          $(self).parents('tr').find('td.info').text(data.msg);
          $(self).parent().prev().text(data.info);
          if(data.data.part){
              $.get(self.href,
                  {"part" : data.data.part, "start" : data.data.start},
                  success,
                  "json"
              );
          }  else {
              window.onbeforeunload = function(){ return null; }
          }
      } else {
          $(self).parents('tr').find('.info').text(data.msg);
      }
  }
});
</script>
</body>
</html>